package cn.zhiwen.mapper;

/**
 * @Auther: wuzhiwen
 * @Date: 2018/12/12 16:38
 * @Description:
 */
public class CrmSetDataMapper {
    public static void main(String[] args) {
        int i = 0;
        ThreadDemo1 threadDemo1 = new ThreadDemo1(i);
        new Thread(threadDemo1).start();
        new Thread(threadDemo1).start();
    }
}

class ThreadDemo1 implements Runnable {
    private int i;

    public ThreadDemo1(int i) {
        this.i = i;
    }

    @Override
    public void run() {

        synchronized (this) {
            try {
                notify();
                Thread.sleep(100);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
        Thread thread = Thread.currentThread();

        while (i < 10) {
            System.out.println(thread.getName() + i + "==========");
            i++;
            try {
                wait();
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }

    }
}
